import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrBonusPaymentVO, HrBonusPaymentForm, HrBonusPaymentQuery } from '@/api/general/humanresources/compensation/bonus/types';

/**
 * 查询员工奖金发放审批列表
 * @param query
 * @returns {*}
 */

export const listHrBonusPayment = (query?: HrBonusPaymentQuery): AxiosPromise<HrBonusPaymentVO[]> => {
  return request({
    url: '/humanresource/hrBonusPayment/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工奖金发放审批详细
 * @param id
 */
export const getHrBonusPayment = (id: string | number): AxiosPromise<HrBonusPaymentVO> => {
  return request({
    url: '/humanresource/hrBonusPayment/' + id,
    method: 'get'
  });
};

/**
 * 新增员工奖金发放审批
 * @param data
 */
export const addHrBonusPayment = (data: HrBonusPaymentForm) => {
  return request({
    url: '/humanresource/hrBonusPayment',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工奖金发放审批
 * @param data
 */
export const updateHrBonusPayment = (data: HrBonusPaymentForm) => {
  return request({
    url: '/humanresource/hrBonusPayment',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工奖金发放审批
 * @param id
 */
export const delHrBonusPayment = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrBonusPayment/' + id,
    method: 'delete'
  });
};
